CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

include_directories(${COMN_DIR}/include)
include_directories(include)
include_directories(.)

include_directories(${DIR_FFMPEG}/include)

if (MSVC)
include_directories(${THIRD_PARTY}/stdint)
endif()

link_directories(${COMN_DIR}/lib)
link_directories(${DIR_FFMPEG_LIB})
link_directories(${DIR_FFMPEG}/bin)

include_directories(${THIRD_PARTY}/Libevent/include)
link_directories(${THIRD_PARTY}/Libevent/lib)
include_directories(${CMAKE_BINARY_DIR}/third_party/Libevent/include)

aux_source_directory(. SOURCES)

add_library(TsCaster SHARED ${SOURCES})

target_link_libraries(TsCaster
	${LIB_PLATFORM}
	debug comnd optimized comn
	${LIB_FFMPEG}
	event
	)

set_target_properties(TsCaster PROPERTIES LINK_INTERFACE_LIBRARIES "")
set_target_properties(TsCaster PROPERTIES INTERFACE_LINK_LIBRARIES "")

if(CMAKE_TOOLCHAIN_FILE)
add_custom_command(TARGET TsCaster
	POST_BUILD
	COMMAND ${CMAKE_STRIP} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libTsCaster.so
	)
endif()

install(TARGETS TsCaster DESTINATION lib)
